<template>
<layout-oa>
  <oa-home-todo v-if="tabKey === OaTabBarType.TODO" />
  <oa-home-proposed v-else-if="tabKey === OaTabBarType.PROPOSED" />
  <my-page v-else-if="tabKey === OaTabBarType.MY" />
</layout-oa>
</template>

<script setup lang="ts">
import LayoutOa from "@/layouts/oa.vue";
import OaHomeTodo from "@/oaPages/index/todo.vue";
import MyPage from "@/oaPages/index/my.vue";
import OaHomeProposed from "@/oaPages/index/proposed.vue";
import {storeToRefs} from "pinia";
import {useOaAppStore} from "@/stores/oa";
import {OaTabBarType} from "@/enum";

const { tabKey } = storeToRefs(useOaAppStore())

watch(() => tabKey.value, (val) => {
  if (val === OaTabBarType.HOME) {
    uni.navigateTo({ url: '/pages/index/index' })
  }
})
</script>

<style scoped lang="scss">

</style>
